package com.linb.pan.server.common.utils;

import com.linb.pan.core.constants.BPanConstants;

import java.util.Objects;

public class ShareIdUtil {

    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void set(Long shareId) {
        threadLocal.set(shareId);
    }

    public static Long get() {
        if (Objects.isNull(threadLocal.get())) {
            return BPanConstants.ZERO_LONG;
        }
        return threadLocal.get();
    }

}
